﻿using CleanArchitecture.Infrastructure.Entities.Business;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CleanArchitecture.Infrastructure.DataMapping.Business
{
    public partial class LanguageMap : NowaEntityTypeConfiguration<Language>
    {
        #region Methods

        /// <summary>
        /// Configures the entity
        /// </summary>
        /// <param name="builder">The builder to be used to configure the entity</param>
        public override void Configure(EntityTypeBuilder<Language> builder)
        {
            builder.ToTable("bus_language");
            builder.HasKey(language => language.Id);

            builder.Property(language => language.DisplayName).HasMaxLength(255).IsRequired();
            builder.Property(language => language.Culture).HasMaxLength(100).IsRequired();
            builder.Property(language => language.LanguageCode).HasMaxLength(100).IsRequired();
            base.Configure(builder);
        }

        #endregion
    }
}
